package com.xmsx.back.pojo;

import java.util.Objects;

public class Rate {

    private int year;
    private int number = 0;
    private double rate = 0;

    public Rate() {
    }

    public Rate(int year, int number, double rate) {
        this.year = year;
        this.number = number;
        this.rate = rate;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public double getRate() {
        return rate;
    }

    public void setRate(double rate) {
        this.rate = rate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Rate)) return false;
        Rate rate1 = (Rate) o;
        return getYear() == rate1.getYear() &&
                getNumber() == rate1.getNumber() &&
                Double.compare(rate1.getRate(), getRate()) == 0;
    }

    @Override
    public int hashCode() {
        return Objects.hash(getYear(), getNumber(), getRate());
    }

    @Override
    public String toString() {
        return "IndexRate{" +
                "year=" + year +
                ", number=" + number +
                ", rate=" + rate +
                '}';
    }
}
